package com.xuebang.admin.mapper;

import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.SelectKey;
import org.apache.ibatis.annotations.UpdateProvider;

public interface BaseMapper<T> {

	@InsertProvider(type = SQLProvider.class, method = "insert")
	@SelectKey(statement = "select last_insert_id()", keyProperty = "id", before = false, resultType = Long.class)
	int insert(T entity);

	@UpdateProvider(type = SQLProvider.class, method = "update")
	int update(T entity);

	@DeleteProvider(type = SQLProvider.class, method = "delete")
	int delete(T entity);

}
